import { lazy } from "react";
import {createBrowserRouter} from 'react-router-dom'
import App from "../App";
const Home =lazy(()=>import('../pages/home/Index'))
const Order =lazy(()=>import('../pages/order/Index'))
const Login =lazy(()=>import('../pages/login/Index'))
const routes=[
    {
        path:'/',
        element:<App></App>,
        // 子路由
        children:[
            {
                path:'/home',
                element:<Home></Home>
            }
        ]
    },
    // 一级路由
    {
        path:'/login',
        element:<Login></Login>
    },
    {
        path:'/order',
        element:<Order></Order>
    }
   
]
const router=createBrowserRouter(routes)
export default router